///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// Log type you can configure here
///</describe>
/// <date>2019/7/16</date>
///***********************************************************************
#ifndef LOGTYPE_H
#define LOGTYPE_H

#include <string>

namespace SystemTool
{
	namespace IO
	{
		enum LOG_TYPE_ENUM
		{
			// Log the common information
			LOG_INFOR = 0,

			// Log the debug message
			LOG_DEBUG,

			// Log the warn message
			LOG_WARN,

			// Log the error message
			LOG_ERROR,
		};

		enum LOG_CONFIG_ENUM
		{
			// The log file's max size
			MAX_FILE_SIZE = 800 * 1024 * 1024,

			// The container of log's max contains
			MAX_MSG_NUM = 1024,

			// The number of log type
			LOG_TYPE_NUM = 4
		};
	}
}

static std::string GetFileName(std::string strFileName)
{
	int iPos = strFileName.find_last_of('\\');

	if (iPos == -1)
	{
		return strFileName;
	}

	std::string strFinalFileName = strFileName.substr(iPos + 1);

	return strFinalFileName;
}

static std::string GetFunctionName(std::string strName)
{
	std::string strFunctionName = strName;

	return strFunctionName;
}

#define _FILE_  GetFileName(std::string(__FILE__))

#define _FUNCNAME_ GetFunctionName(std::string(__FUNCTION__))

#endif // LOGTYPE_H
